package com.phunware.swipeToDismiss.demo;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.phunware.swipeToDismiss.R;
import com.phunware.swipeToDismiss.interfaces.ViewBinder;

public class DataBinder implements ViewBinder<Integer> {

	@Override
	public View bind(Integer object, View convertView, ViewGroup parent) {
		if(null == convertView){
			convertView = LayoutInflater.from(parent.getContext()).inflate(
					R.layout.item, parent, false);
		}
		TextView text = (TextView) convertView.findViewById(R.id.text);
		text.setText("Item " + object);
		return convertView;
	}

}
